#ifndef EVENTLOOPTHREADPOOL
#define EVENTLOOPTHREADPOOL

#include <vector>
#include <memory>

#include "EventLoopThread.h"

class EventLoop;

class EventLoopThreadPool {
public:
    EventLoopThreadPool(EventLoop* baseLoop);
    ~EventLoopThreadPool() = default;
    
    void setThreadNum(int numThreads) { numThreads_ = numThreads; }

    void start();

    EventLoop* getNextLoop();

private:
    EventLoop* baseLoop_;
    int numThreads_;
    int nextLoopIdx;
    std::vector<std::unique_ptr<EventLoopThread>> threads_;
    std::vector<EventLoop*> loops_;

};

#endif